From a9170d635241167f93da3e727175c58425fd7e98 Mon Sep 17 00:00:00 2001 From: "iap10@freefall.cl.cam.ac.uk" Date: Sat, 12 Feb 2005 00:48:04 +0000 Subject: [PATCH] bitkeeper revision 1.1188 (420d5244F1WAs2mvIW8E0-0RB5AlRw) Subject: [PATCH] dm-destroy.patch Clicking on the power off button calls xm destroy as well. Signed-off-by: Arun Sharma Signed-off-by: ian@xensource.com --- tools/ioemu/gui/gui.cc | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/tools/ioemu/gui/gui.cc b/tools/ioemu/gui/gui.cc index a6cd30732a..d3c2383d1e 100644 --- a/tools/ioemu/gui/gui.cc +++ b/tools/ioemu/gui/gui.cc @@ -293,6 +293,10 @@ bx_gui_c::reset_handler(void) BX_CPU(i)->reset(BX_RESET_HARDWARE); } +#ifdef BX_USE_VMX +char xm_destroy[PATH_MAX]; +#endif + void bx_gui_c::power_handler(void) { @@ -300,9 +304,14 @@ bx_gui_c::power_handler(void) // to quit. Change panics to fatal for the GUI and then do a panic. bx_user_quit = 1; LOG_THIS setonoff(LOGLEV_PANIC, ACT_FATAL); - BX_PANIC (("POWER button turned off.")); + BX_INFO(("POWER button turned off.")); // shouldn't reach this point, but if you do, QUIT!!! fprintf (stderr, "Bochs is exiting because you pressed the power button.\n"); + snprintf(xm_destroy, PATH_MAX, "xm destroy %d", domid); + BX_INFO(("executing: %s\n", xm_destroy)); + if (system(xm_destroy) != 0) { + BX_PANIC(("failed\n")); + } BX_EXIT (1); } -- 2.30.2